package labeling;

import java.util.ArrayList;
import java.util.List;

import data.Data;

public class Labeling3Classes {
	
	List<Data> pos = new ArrayList<Data>();
	List<Data> neg = new ArrayList<Data>();
	List<Data> neu = new ArrayList<Data>();
	
	public Labeling3Classes(List<Data> data, double avg, double[] ubias, double[] ibias, double epsilon) {
		for(Data datum : data){
			int uid = datum.uid;
			short iid = datum.iid;
			byte rat = datum.rat;
			
			double pred = avg + ubias[uid-1] + ibias[iid-1];
			
			if(rat - pred - epsilon > 0){
				pos.add(datum);
			}
			else if (rat - pred + epsilon < 0){
				neg.add(datum);
			}
			else {
				neu.add(datum);				
			}
		}
	}

	public List<Data> getPos() {
		return pos;
	}

	public List<Data> getNeg() {
		return neg;
	}

	public List<Data> getNeu() {
		return neu;
	}

}
